/*---------------------------------------------------
-----------------------------------------------------
Filename:	init_windowpage.m
Version:	1.1

Type:		maki/attrib definitions
Date:		08. Jul. 2006 - 17:28 
Author:		Martin Poehlmann aka Deimos
E-Mail:		martin@skinconsortium.com
Internet:	www.skinconsortium.com
		www.martin.deimos.de.vu
-----------------------------------------------------
Depending Files:
		scripts/infocompcore.maki
		scripts/suicore.maki
		scripts/browser.maki
		scripts/fileinfo.maki
-----------------------------------------------------
---------------------------------------------------*/

#ifndef included
#error This script can only be compiled as a #include
#endif

#include "gen_pageguids.m"


#define CUSTOM_PAGE_FILEINFO "{6A619628-6A91-46e3-A3F3-5C1B2D93DF4F}"

Function initAttribs_windowpage();

Global ConfigAttribute sui_browser_attrib, sui_eq_attrib, sui_config_attrib;
Global ConfigAttribute ic_fileinfo, ic_cover_fileinfo, ic_vis, ic_vis_fileinfo, ic_hidden, ic_eq, ic_config, _plsc_ic_attrib;
Global ConfigItem custom_page_fileinfo;


#define CUSTOM_PAGE_INFOCOMP "{8D3829F9-5790-4c8e-9C3A-C397D3602FF9}"
Class ConfigAttribute InfoLineAttribute;
Global InfoLineAttribute infocomp_show_rating, infocomp_show_genre, infocomp_show_year, infocomp_show_track, infocomp_show_publisher;
Global ConfigAttribute infocomp_cycle;


initAttribs_windowpage()
{
	initPages();

	sui_eq_attrib = custom_windows_page.newAttribute("Equalizer\tAlt+G", "0");
	sui_browser_attrib = custom_windows_page.newAttribute("Web Browser\tAlt+X", "0");
	sui_config_attrib = custom_windows_page.newAttribute("Skin Settings\tAlt+C", "0");

	custom_page_fileinfo = addConfigSubMenu(optionsmenu_page, "Multi Content View", CUSTOM_PAGE_FILEINFO);

	ic_fileinfo = custom_page_fileinfo.newAttribute("File Info", "1");
	ic_vis = custom_page_fileinfo.newAttribute("Visualization  ", "0");
	ic_eq = custom_page_fileinfo.newAttribute("Equalizer", sui_eq_attrib.getData());
	ic_config = custom_page_fileinfo.newAttribute("Skin Settings", sui_config_attrib.getData());
	_plsc_ic_attrib = custom_page_fileinfo.newAttribute("Stored Playlists", "0");
//	addMenuSeparator(custom_page_fileinfo);
//	ic_hidden = custom_page_fileinfo.newAttribute("Hidden", "0");
	addMenuSeparator(custom_page_fileinfo);
	ConfigItem fileinfo_parent = addConfigSubMenu(custom_page_fileinfo, "File Info Components", CUSTOM_PAGE_INFOCOMP);
	ic_vis_fileinfo = fileinfo_parent.newAttribute("Visualization ", "0");
	ic_cover_fileinfo = fileinfo_parent.newAttribute("Album Art", "1");
	addMenuSeparator(fileinfo_parent);
	infocomp_show_track = fileinfo_parent.newAttribute("Show Track #", "1");
	infocomp_show_year = fileinfo_parent.newAttribute("Show Year", "1");
	infocomp_show_genre = fileinfo_parent.newAttribute("Show Genre", "1");
	infocomp_show_publisher = fileinfo_parent.newAttribute("Show Publisher", "1");
	infocomp_show_rating = fileinfo_parent.newAttribute("Show Song Rating", "1");
	addMenuSeparator(fileinfo_parent);
	infocomp_cycle = fileinfo_parent.newAttribute("Cycle File Info", "1");

}

#ifdef MAIN_ATTRIBS_MGR
System.onKeyDown(String key) {
	if (key == "alt+x")
	{
		if (sui_browser_attrib.getData() == "0") sui_browser_attrib.setData("1");
		else sui_browser_attrib.setData("0");
		complete;
	}
	/*if (key == "alt+n")
	{
		if (sui_browser_attrib.getData() == "0") sui_browser_attrib.setData("1");
		else sui_browser_attrib.setData("0");
		complete;
	}*/
	/*if (key == "alt+c")
	{
		if (sui_cover_attrib.getData() == "0") sui_cover_attrib.setData("1");
		else sui_cover_attrib.setData("0");
		complete;
	}*/
	if (key == "alt+c")
	{
		if (sui_config_attrib.getData() == "0") sui_config_attrib.setData("1");
		else sui_config_attrib.setData("0");
		complete;
	}
	if (key == "alt+g")
	{
		if (sui_eq_attrib.getData() == "0") sui_eq_attrib.setData("1");
		else sui_eq_attrib.setData("0");
		complete;
	}
	/*if (key == "ctrl+f") {
		navigateUrl(getPath(getPlayItemString()));
		complete;
	}*/
}

ic_fileinfo.onDataChanged()
{
	//debugString("ic_fileinfo.setData(" + getData() + ")", 9);
	if (attribs_mychange2) return;
	NOOFF
	attribs_mychange2 = 1;
	ic_vis.setData("0");
	ic_eq.setData("0");
	ic_config.setData("0");
	_plsc_ic_attrib.setData("0");
	attribs_mychange2 = 0;
}

ic_vis.onDataChanged()
{
	//debugString("ic_vis.setData(" + getData() + ")", 9);
	if (attribs_mychange2) return;
	NOOFF
	attribs_mychange2 = 1;
	ic_fileinfo.setData("0");
	ic_eq.setData("0");
	ic_config.setData("0");
	_plsc_ic_attrib.setData("0");
	attribs_mychange2 = 0;
}

ic_eq.onDataChanged()
{
	if (!attribs_mychange)
	{
		attribs_mychange = 1;
		sui_eq_attrib.setData(getData());
		attribs_mychange = 0;
	}
	//debugString("ic_vis_fileinfo.setData(" + getData() + ")", 9);
	if (attribs_mychange2) return;
	NOOFF
	attribs_mychange2 = 1;
	ic_fileinfo.setData("0");
	ic_vis.setData("0");
	ic_config.setData("0");
	_plsc_ic_attrib.setData("0");
	attribs_mychange2 = 0;
}

ic_config.onDataChanged()
{
	if (!attribs_mychange)
	{
		attribs_mychange = 1;
		sui_config_attrib.setData(getData());
		attribs_mychange = 0;
	}
	//debugString("ic_vis_fileinfo.setData(" + getData() + ")", 9);
	if (attribs_mychange2) return;
	NOOFF
	attribs_mychange2 = 1;
	ic_fileinfo.setData("0");
	ic_vis.setData("0");
	ic_eq.setData("0");
	_plsc_ic_attrib.setData("0");
	attribs_mychange2 = 0;
}

_plsc_ic_attrib.onDataChanged()
{
	//debugString("ic_fileinfo.setData(" + getData() + ")", 9);
	if (attribs_mychange2) return;
	NOOFF
	attribs_mychange2 = 1;
	ic_vis.setData("0");
	ic_eq.setData("0");
	ic_config.setData("0");
	ic_fileinfo.setData("0");
	attribs_mychange2 = 0;
}

sui_eq_attrib.onDataChanged()
{
	//debugString("ic_vis_fileinfo.setData(" + getData() + ")", 9);
	if (attribs_mychange) return;
	attribs_mychange = 1;
	if (getData() == "1") ic_eq.setData("1");
	else ic_fileinfo.setData("1");
	attribs_mychange = 0;
}

sui_config_attrib.onDataChanged()
{
	//debugString("ic_vis_fileinfo.setData(" + getData() + ")", 9);
	if (attribs_mychange) return;
	attribs_mychange = 1;
	if (getData() == "1") ic_config.setData("1");
	else ic_fileinfo.setData("1");
	attribs_mychange = 0;
}
#endif